<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
include "header.php";
include "footer.php";

$page = empty($_GET ['P']) ? 1 : $_GET ['P'];//0
$page = ($page < 1) ? 1 : $page;


$sql = "SELECT * FROM  wish LIMIT" .($page -1)*5 ." , 5" ;



$result = $conn->query($sql);

$arrlist = array();

if ($result->num_rows > 0) {  
    // 输出每行数据

    while($row = $result->fetch_assoc()) {

        array_push($arrlist, $row);        
    }
} else {
    echo "0 results";
}
$conn->close(); 
?>

<div id="right">
	
<table border="1">
<tr>
<td>序号</td>
<td>留言�?/td>
<td>留言内容</td>
<td>留言时间</td>
<td>操作</td>
</tr>
<?php foreach($arrlist as $vo){ ?>
<tr>
<td><?php echo $vo['id'];?></td>
<td><?php echo $vo['username'];?></td>
<td><?php echo $vo['content'];?></td>
<td><?php echo $vo['time_at'];?></td>
<td><span><a>修改</a></span><span><a>删除</a></span></td>
</tr>
<?php } ?>
</table>
    
</div>

